import request from '@/utils/request';


//获取类别列表
export const getCategory = (parentId, companyId) => {
    return request({
        url: '/eduM2/eduCourse/showCourseCategoryTree/' + companyId + '/' + parentId,
        method: 'get',
    })
}

//获取三级列表
export const getClassCategory = (parentId, companyId, grade) => {
    return request({
        url: '/eduM2/eduCourse/showCourseClassCategoryTree/' + companyId + '/' + parentId + '/' + grade,
        method: 'get',
    })
}

//新增大类
export const addRootCategory = (courseName, companyId) => {
    return request({
        url: '/eduM2/eduCourse/addCourseCategoryParent/' + companyId + '/' + courseName,
        method: 'get',
    })
}

//新增子类
export const addSubCategory = (parentId, courseName, level) => {
    return request({
        url: '/eduM2/eduCourse/addCourseCategoryChildren/' + parentId + '/' + courseName + '/' + level,
        method: 'get',
    })
}

//修改类别
export const modifyCategory = (id, courseName) => {
    return request({
        url: '/eduM2/eduCourse/updateCourseCategory/' + id + '/' + courseName,
        method: 'get',
    })
}

//删除类别
export const removeCategory = (list) => {
    return request({
        url: '/eduM2/eduCourse/deleteCourseCategoryByIds',
        method: 'post',
        data: list
    })
}


// 获取班级列表
export const getClassList = (companyId) => {
    return request({
        url: '/eduM2/eduClass/getClassList/'+companyId,
        method: 'get',
    })
}